#!/usr/bin/env python

"""

Gwibber Client Test Suite

"""

import sys, unittest, tests
from os.path import join, dirname, exists, realpath

def runTests(suite):
    testRunner = unittest.TextTestRunner()
    result = testRunner.run(suite)
    sys.exit(not result.wasSuccessful())

# run tests against the local ./gwibber module
source_tree_gwibber = join(dirname(__file__), "gwibber")
if exists(join(source_tree_gwibber, "client.py")):
    sys.path.insert(0, realpath(dirname(source_tree_gwibber)))
    try:
        runTests(tests.suite())
    finally:
        del sys.path[0]
else:
    exit(1)
